package org.example.config.sequence.configs.definition;

import org.example.config.sequence.configs.beans.MyImportSelectorBean;
import org.example.config.sequence.inspect.Inspector;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.function.Predicate;

/**
 * 通过{@link Import @Import}方式加载
 */
public class MyImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        Inspector.log(MyImportSelector.class, "selectImports");
        return new String[]{
                MyImportSelectorBean.class.getName()
        };
    }

    @Override
    public Predicate<String> getExclusionFilter() {
        return null;
    }
}
